import React from "react";
import { connect } from "dva";
import { View, Text, Dimensions } from "react-native";
import H5Nav from "../lib/H5Nav";
const HEIGHT = Dimensions.get("window").height;
class List extends React.Component {
  _push = () => {
    H5Nav.push("/test", { params: "123456", test: "23423" });
  };
  _replace = () => {
    H5Nav.replace("/test");
  };
  render() {
    return (
      <View
        style={{
          justifyContent: "center",
          alignItems: "center",
          height: HEIGHT
        }}
      >
        <div onClick={this._push}>push</div>
        <div onClick={this._replace}>replace </div>
        <Text>{"connect数据：" + this.props.data}</Text>
      </View>
    );
  }
}

export default connect(({ list }) => {
  return {
    data: list.data
  };
})(List);
